<form class="checkoutform" action="{:U('update')}" method="post" style="min-height:1000px; margin:-15px;">
  <input type="hidden" name="id" value="{$info.id}">
  <section class="panel">
    <header class="panel-heading custom-tab turquoise-tab">
      <ul class="nav nav-tabs">
        <li class="active"> <a data-toggle="tab" href="#home3"> 基本信息 </a> </li>
        
        <li> <a data-toggle="tab" href="#home33"> 扩展分类 </a> </li>
        
        
        
        <li class=""> <a data-toggle="tab" href="#home4"> 商品图片 </a> </li>
        <li> <a data-toggle="tab" href="#about3"> 商品详情 </a> </li>
        
        <if condition="getAccessMenu($accessList, 'Admin', 'Order', 'index')">
        <li> <a data-toggle="tab" href="#about33"> 高级设置 </a> </li>
        <li> <a data-toggle="tab" href="#about4"> 商品属性 </a> </li>
        <li class=""> <a data-toggle="tab" href="#contact3"> 营销设置 </a> </li>
        </if>
        
        
        <li class=""> <a data-toggle="tab" href="#contact4"> SEO </a> </li>
      </ul>
    </header>
    <div class="panel-body">
      <div class="tab-content">
        <div id="home3" class="tab-pane active">
          <div class="form-group">
            <div class="row">
              <div class="col-sm-8">
                <label class="control-label">商品名称 <notempty name="relateSiteList"><div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-default btn-xs dropdown-toggle" type="button">其它版本 <span class="caret"></span></button>
                                            <ul role="menu" class="dropdown-menu"> 
                                            
                                            <volist name="relateSiteList" id="s">
                                                <li><a href="##" onClick="_openWindow('<?php echo U('relateedit', array('site_id' => $s['id'], 'sitesourceid' => $siteid, 'table' => 'Product', 'field' => 'title', 'k' => $info['id'], 'type' => 'text'));?>', 400, '{$info.title}【{$s.title}】', '保存',  function(){ }, '');">{$s.title}</a></li></volist>
                                            </ul>
                                        </div></notempty></label>
                <input class="form-control" datatype="*"  name="title" value="{$info.title}" id="title" type="text">
              </div>
              <div class="col-sm-4">
                <label class="control-label">商品分类</label>
                <select class="form-control" name="category_id" id="category_id">
                  <option value="">请选择</option>
                  <volist name="cate_list" id="vo"> <option 
                    <eq name="info['category_id']" value="$vo['id']">selected="selected"</eq>
                     value="{$vo.id}">{:getdeepstr($vo['deep'])}{$vo.title}
          </volist>
                </select>
              </div>
            </div>
          </div>
          <div class="form-group">
            <div class="row">
              <div class="col-sm-8">
                <label class="control-label">简述</label>
                <textarea class="form-control" placeholder="简短的文字描述" name="remark" class="" cols="50" rows="3" id="remark">{$info.remark}</textarea>
              </div>
              <div class="col-sm-4">
                <label class="control-label">商品货号</label>
                <input class="form-control" name="code" id="code" type="text" placeholder="如：A001" value="{$info.code}">
              </div>
            </div>
          </div>
          <div class="form-group">
            <div class="row">
              <div class="col-sm-3">
                <label class="control-label">售价</label>
                <input class="form-control" datatype="*"  name="price" placeholder="出售价格，如：50" value="{$info.price}" id="price" type="text">
              </div>
              <div class="col-sm-3">
                <label class="control-label">原价</label>
                <input class="form-control"  name="originalCost" value="{$info.originalCost}" id="originalCost" type="text">
              </div>
              <div class="col-sm-3">
                <label class="control-label">库存</label>
                <input class="form-control" datatype="*" name="stocks" value="{$info.stocks}" id="stocks" type="text">
              </div>
              <div class="col-sm-3">
                <label class="control-label">分成金额</label>
                <input class="form-control" datatype="*" placeholder="分配佣金，如：10" name="affmoney" value="{$info.affmoney}" id="affmoney" type="text">
              </div>
            </div>
          </div>
          <div class="form-group">
            <div class="row">
              <div class="col-sm-3">
                <label class="control-label">重量[kg]</label>
                <input class="form-control" datatype="*" name="weight" value="{$info.weight}" id="weight" type="text">
              </div>
              <div class="col-sm-3">
                <label class="control-label">折扣率</label>
                <input class="form-control" name="discount" value="{$info.discount}" id="discount" type="text">
              </div>
              <div class="col-sm-3">
                <label class="control-label">单位[如：斤]</label>
                <input class="form-control" name="unit" value="{$info.unit}" id="unit" type="text">
              </div>
              <div class="col-sm-3">
                <notempty name="brandList">
                  <div class="form-group">
                    <label class="control-label">品牌</label>
                    <select class="form-control" name="brand_id" id="brand_id">
                      <option value="">请选择</option>
                      <volist name="brandList" id="vo"> <option 
          
                  
                        <eq name="vo['id']" value="$info['brand_id']">selected="selected"</eq>
                        
                  
           value="{$vo.id}">{$vo.title}
          
                  
                        </option>
                      </volist>
                    </select>
                  </div>
                </notempty>
              </div>
            </div>
          </div>
        </div>
        
        
        <div id="home33" class="tab-pane">
            
            
            
            <div class="form-group">
    
    
    
    <volist name="categorylist" id="vo">
      <?php $deep = $categorylist[$key - 1]['deep']; if($deep != $vo['deep']){?>
      <br>
      <?php }?>
      
      
      
      
      
      <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input <?php if(in_array($vo['id'], $categorylistids)){?>checked<?php }?> type="checkbox" name="category_goods[]" value="{$vo.id}" />
              <label> {$vo.title}</label>
            </div>
          </div>
      
      
      
      
      
    </volist>
  </div>
            
            
        </div>
        
        
        <div id="home4" class="tab-pane">
        
        
        
        
         <div class="form-group">
    
      <label class="control-label">封面图</label>
         <div><input name="img_url" type="hidden" value="{$info.img_url}" /><img onclick="showImgBox(this);" src="<notempty name="info['img_url']">{:getThumbPath($info['img_url'])}<else/>__PUBLIC__/Admin/images/defaultimg.png</notempty>" id="img_url" height="80" /></div>
     
   </div>
        
        
        
        
        
        
          <if condition="!isMobile()">
        
        
        <div class="form-group">
     
      
      <div id="img_list">
          <volist name="mimg_url_list" id="vo">
            <div url="{$vo}" class="img_one"><div class="sort" style="padding:5px; background:#7CBD8C"><span class="fl btn-xs" onClick="ml(this);">&lt;</span><span class="fr btn-xs" onClick="mr(this);">&gt;</span><div class="clearfix"></div></div><img height="80" width="80" src="{:getThumbPath($vo)}"><a href="javascript:void(0);" onClick="mdel_img('{$vo}');">删除</a></div>
            </volist>
        </div>
        <div class="clearfix"></div>
         <include file="Public:mupload" />
      
   </div>
   
   
   <else/>
   
   
   
   
   <div class="form-group">
     
      <label class="control-label">图组</label>
      <div id="img_list">
          <div id="img_listBox" style="display:inline;"><volist name="mimg_url_list" id="vo">
            <div url="{$vo}" class="img_one"><div class="sort" style="padding:5px; background:#7CBD8C"><span class="fl btn-xs" onClick="ml(this);">&lt;</span><span class="fr btn-xs" onClick="mr(this);">&gt;</span><div class="clearfix"></div></div><img height="80" width="80" src="{:getThumbPath($vo)}"><a href="javascript:void(0);" onClick="mdel_img('{$vo}');">删除</a><input type="hidden" name="mimg_url[]" value="{$vo}" /></div>
            </volist></div>
            
            <div url="" class="img_one"><input type="hidden" value=""><img height="80" onClick="showImgBox(this);" width="80" src="__PUBLIC__/Admin/images/defaultimg.png" id="addimg__"></div>
        </div>
        <div class="clearfix"></div>
        
      
   </div>
   <style>
	.img_one{position:relative; padding:4px; width:88px; height:130px; margin-left:4px; float:left;}
	.img_one .sort span{cursor:pointer; text-align:center; display:inline-block; background:#fff;}
	.img_one a{position:absolute; bottom:0px; height:24px; line-height:24px; width:88px; left:0px; text-align:center;}
.fl{float:left;}
.fr{float:right;}
</style>
   <script>
       document.getElementById('addimg__').onload = function(){
		  var mhurl = $('#addimg__').prev('input').val();
		  //alert(mhurl);
		  if(!$('#addimg__').hasClass('f')){
			  $('#addimg__').addClass('f');
		      return false;
		  }
		  var mh = $('<div url="'+mhurl+'" class="img_one"><div class="sort" style="padding:5px; background:#7CBD8C"><span class="fl btn-xs" onClick="ml(this);">&lt;</span><span class="fr btn-xs" onClick="mr(this);">&gt;</span><div class="clearfix"></div></div><img height="80" width="80" src="__PUBLIC__'+mhurl+'"><a href="javascript:void(0);">删除</a><input type="hidden" name="mimg_url[]" value="'+mhurl+'" /></div>');
		  mh.appendTo('#img_listBox');
		  
		 mh.find('a').click(function(e) {
            mdel_img(mhurl);
        });
		$('#addimg__').removeClass('f');
		  document.getElementById('addimg__').src = '__PUBLIC__/Admin/images/defaultimg.png';
	   }
	   function mr(e){
		$(e).parent('div').parent('div').next().after($(e).parent('div').parent('div'));
		
		
	}
	function ml(e){
		$(e).parent('div').parent('div').after($(e).parent('div').parent('div').prev());
		
		
	}
   </script>
   
   </if>
        </div>
        
        
        <div id="about33" class="tab-pane">
        
        <div class="row">
             <div class="col-sm-6"><div class="form-group">
            <label class="control-label">上架时间</label>
            <input class="form-control" name="starttime" value="{:date('Y-m-d H:i:s', $info['starttime'])}" id="starttime" type="text">
            <div class="alert alert-warning" role="alert" style="margin-top:5px;"> <strong>温馨提示：</strong> 设置一个自动上架的时间，到达这个时间点商品自动上架，格式是Y-m-d H:i:s(如：2016-07-09 20:00:00)，留空则立即上架 </div>
          </div></div>
             <div class="col-sm-6"><div class="form-group">
            <label class="control-label">下架时间</label>
            <input class="form-control" name="timeout" value="{:date('Y-m-d H:i:s', $info['timeout'])}" id="timeout" type="text">
            <div class="alert alert-warning" role="alert" style="margin-top:5px;"> <strong>温馨提示：</strong> 设置一个自动下架的时间，到达这个时间点商品自动下架，格式是Y-m-d H:i:s(如：2016-07-09 20:00:00)，留空则不会自动下架 </div>
          </div></div>
        </div>
         
          
          
          
          
          
          
          
          
          
          
          
          
         
  <notempty name="SupplierList">
    <div class="form-group">
      <label class="control-label">供货商</label>
      <select class="form-control" name="supplier_id" id="supplier_id">
        <option value="">请选择</option>
        <volist name="SupplierList" id="vo"> <option 
        
          <eq name="vo['id']" value="$info['supplier_id']">selected="selected"</eq>
          
         value="{$vo.id}">{$vo.susername}
        
          </option>
        </volist>
      </select>
    </div>
  </notempty>
  
   
  
  
  
  
  
  
  
  
  
  <div class="form-group">
    <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="need_shipping" type="radio" value="1" 
      
      <eq name="info['need_shipping']" value="1">checked="checked"</eq>
      />
              <label>需要物流</label>
            </div>
          </div>
  
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="need_shipping" type="radio" value="0" 
      
      <eq name="info['need_shipping']" value="0">checked="checked"</eq>
      />
              <label>不需要物流</label>
            </div>
          </div>
  </div>
  <div class="form-group">
  
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="noshippingfee" type="radio" value="1" 
      
      <eq name="info['noshippingfee']" value="1">checked="checked"</eq>
      />
              <label>包邮　　</label>
            </div>
          </div>
          
          
          
          
          
          
          
          <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="noshippingfee" type="radio" value="0" 
      
      <eq name="info['noshippingfee']" value="0">checked="checked"</eq>
      />
              <label>不包邮</label>
            </div>
          </div>
  
  
  
  
  </div>
  <div class="form-group">
  
  
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="status" type="radio" value="1" 
      
      <eq name="info['status']" value="1">checked="checked"</eq>
      />
              <label>上架　　</label>
            </div>
          </div>
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="status" type="radio" value="0" 
      
      <eq name="info['status']" value="0">checked="checked"</eq>
      />
              <label>下架</label>
            </div>
          </div>
  </div>
  <div class="form-group">
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="display" type="radio" value="1" 
      
      <eq name="info['display']" value="1">checked="checked"</eq>
      />
              <label>总是显示详情</label>
            </div>
          </div>
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="display" type="radio" value="0" 
      
      <eq name="info['display']" value="0">checked="checked"</eq>
      />
              <label>需要购买后显示详情</label>
            </div>
          </div>
  
  
   
  </div>
  
  <div class="form-group">
  
  
    
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="affpass" type="radio" value="0" 
      
      <eq name="info['affpass']" value="0">checked="checked"</eq>
      />
              <label>分佣需要审核</label>
            </div>
          </div>
  
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="affpass" type="radio" value="1" 
      
      <eq name="info['affpass']" value="1">checked="checked"</eq>
      />
              <label>分佣直接发红包</label>
            </div>
          </div>
  
  
    
  </div>
  <div class="form-group">
  
  
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="autoconfirm" type="radio" value="1" 
      
      <eq name="info['autoconfirm']" value="1">checked="checked"</eq>
      />
              <label>购买后自动确认</label>
            </div>
          </div>
  
  <div class="icheck" style="display:inline-block;">
            <div class="square-red single-row">
              <input name="autoconfirm" type="radio" value="0" 
      
      <eq name="info['autoconfirm']" value="0">checked="checked"</eq>
      />
              <label>购买后客户确认</label>
            </div>
          </div>
  
  
  
  
  </div>
<!--  <div class="form-group">
    <label class="control-label">谁可以购买</label>
    <volist name="getLevelNameList" id="vo">
      <label class="checkbox-inline"> <input name="levelBuy" type="radio" id="is_nav_9" value="{$key}" 
        
        <eq name="info['levelBuy']" value="$key">checked="checked"</eq>
        />
        {$vo}</label>
    </volist>
  </div>-->
        
        
        </div>
        
        
        
        
        <div id="about3" class="tab-pane">
          <div class="form-group">
            <label class="control-label">商品描述内容 <notempty name="relateSiteList"><div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-default btn-xs dropdown-toggle" type="button">其它版本 <span class="caret"></span></button>
                                            <ul role="menu" class="dropdown-menu" style="z-index:90000000;"> 
                                            
                                            <volist name="relateSiteList" id="s">
                                                <li><a href="##" onClick="_openWindow('<?php echo U('relateedit', array('site_id' => $s['id'], 'sitesourceid' => $siteid, 'table' => 'Product', 'field' => 'content', 'k' => $info['id'], 'type' => 'editor'));?>', 800, '{$info.title}【{$s.title}】', '保存',  function(){ }, '');">{$s.title}</a></li></volist>
                                            </ul>
                                        </div></notempty></label>
            <html:editor id="editor" name="content" type="UEDIT" style="height:400px; width:100%;">{$info.content}</html:editor>
          </div>
        </div>
        <div id="about4" class="tab-pane">
          <div class="form-group">
            <label class="control-label">商品属性 <notempty name="relateSiteList"><div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-default btn-xs dropdown-toggle" type="button">其它版本 <span class="caret"></span></button>
                                            <ul role="menu" class="dropdown-menu" style="z-index:90000000;"> 
                                            
                                            <volist name="relateSiteList" id="s">
                                                <li><a href="##" onClick="_openWindow('<?php echo U('relateedit', array('site_id' => $s['id'], 'sitesourceid' => $siteid, 'table' => 'Product', 'field' => 'attrtext', 'k' => $info['id'], 'type' => 'editor'));?>', 800, '{$info.title}【{$s.title}】', '保存',  function(){ }, '');">{$s.title}</a></li></volist>
                                            </ul>
                                        </div></notempty></label>
            <html:editor id="attrtext" name="attrtext" type="UEDIT" style="height:300px; width:100%;">{$info.attrtext}</html:editor>
          </div>
        </div>
        <div id="contact3" class="tab-pane ">
         
          <notempty name="getLevelNameList">
            <volist name="getLevelNameList" id="vo">
              <div class="form-group">
                <div style="border:1px solid #CFCFCF; padding-top:15px; background:#fff;">
                  <label class="control-label">【{$vo}】等级价格</label>
                  <div class="col-sm-4">
                    <input name="levelkey[]" type="hidden" value="{$key}" />
                    <input style="" class="form-control" name="levelprice[]" value="{$info['levelpriceconfig'][$key]['levelprice']}" type="text">
                    <br>
                  </div>
                  <label class="control-label">分成金额</label>
                  <div class="col-sm-4">
                    <input style="" class="form-control" name="levelaff[]" value="{$info['levelpriceconfig'][$key]['levelaff']}" type="text">
                    <br>
                  </div>
                  <div style="clear:both;"></div>
                </div>
              </div>
            </volist>
          </notempty>
          <div class="form-group">
            <label class="control-label">数量优惠</label>
            <table class="table table-bordered hidden" width="100%" border="0" cellspacing="0" cellpadding="0">
              <tbody id="numpriceconfightml">
                <tr>
                  <td><input name="numkey[]" type="text" class="form-control" value="0" /></td>
                  <td><input style="" class="form-control" name="numprice[]" value="0" type="text"></td>
                  <td><input style="" class="form-control" name="numaff[]" value="0" type="text"></td>
                  <td style="text-align:center; vertical-align:middle;"><span onClick="deletenumpriceconfig(this);" class="close">x</span></td>
                </tr>
              </tbody>
            </table>
            <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
              <tbody id="numpriceconfightmlbox">
                <tr>
                  <td>数量</td>
                  <td>优惠价</td>
                  <td>分成金额</td>
                  <td>操作</td>
                </tr>
                <tr>
                  <td colspan="4"><a href="javascript:void(0);" onClick="addnumpriceconfig(this);" class="btn btn-success">增加</a></td>
                </tr>
                <volist name="numpriceconfig" id="vo">
                  <tr>
                    <td><input name="numkey[]" type="text" class="form-control" value="{$vo.numkey}" /></td>
                    <td><input style="" class="form-control" name="numprice[]" value="{$vo.numprice}" type="text"></td>
                    <td><input style="" class="form-control" name="numaff[]" value="{$vo.numaff}" type="text"></td>
                    <td style="text-align:center; vertical-align:middle;"><span onClick="deletenumpriceconfig(this);" class="close">x</span></td>
                  </tr>
                </volist>
              </tbody>
            </table>
          </div>
          
          
          
          <div class="row">
              <div class="col-sm-6"><notempty name="couponList">
            <div class="form-group">
              <label class="control-label">送优惠券</label>
              <select class="form-control" name="coupon_id" id="coupon_id">
                <option value="">请选择</option>
                <volist name="couponList" id="vo"> <option 
          
                  <eq name="vo['id']" value="$info['coupon_id']">selected="selected"</eq>
                  
           value="{$vo.id}">{$vo.title}
          
                  </option>
                </volist>
              </select>
            </div>
          </notempty></div>
              <div class="col-sm-6"> <if condition="getAccessMenu($accessList, 'Admin', 'Member', 'addintegral')">
            <div class="form-group">
              <label class="control-label">赠送积分</label>
              <input class="form-control" name="socre" value="{$info.socre}" id="socre" type="text">
            </div>
          </if></div>
          </div>
          
          
          <div class="row">
              <div class="col-sm-6"><div class="form-group">
            <label class="control-label">限购[0不限]</label>
            <input class="form-control" name="limitBuy" value="{$info.limitBuy}" id="limitBuy" type="text">
          </div></div>
              <div class="col-sm-6"> <div class="form-group">
            <label class="control-label">最小购买量</label>
            <input class="form-control" name="minBuy" value="{$info.minBuy}" id="minBuy" type="text">
          </div></div>
          </div>
          
          
          
          
          
          
          
        </div>
        <div id="contact4" class="tab-pane ">
          <div class="form-group">
            <label class="control-label">外部链接</label>
            <input class="form-control" name="out_link" value="{$info.out_link}" type="text" id="out_link" size="50" />
          </div>
          <div class="form-group">
            <label class="control-label">本文标签</label>
            <input class="form-control" name="tags" value="{$info.tags}" type="text" id="tags" size="50" />
          </div>
          <div class="form-group">
            <label class="control-label">页面标题</label>
            <input class="form-control" name="page_title" value="{$info.page_title}" type="text" id="page_title" size="50" />
          </div>
          <div class="form-group">
            <label class="control-label">页面关键字</label>
            <input class="form-control" value="{$info.keywords}" name="keywords" type="text" id="keywords" size="50" />
          </div>
          <div class="form-group">
            <label class="control-label">页面描述</label>
            <textarea class="form-control" name="description" class="" cols="50" rows="6" id="description">{$info.description}</textarea>
          </div>
        </div>
      </div>
    </div>
    
  </section>
</form>
<style>
 .numpriceconfiglist{position:relative; margin:5px 0;}
 .numpriceconfiglist input{display:inline; width:auto;}

</style>
<script>
    function addnumpriceconfig(e){
		$($('#numpriceconfightml').html()).appendTo('#numpriceconfightmlbox');
	}
	function deletenumpriceconfig(e){
		$(e).parent().parent().remove();
	}

  
  //删除图组图片
	function mdel_img(path){
		
		$('#img_list div').each(function(index, element) {
                        if($(this).attr('url')==path){
							$(this).remove(); 
						}
                    });
					
					$('#picmsg input').each(function(index, element) {
                        if($(this).val()==path){
							$(this).remove();
						}
                    });
		
	}
	
	
  </script>